window.zhsngq_data = [];
window.document.createElement_copy = window.document.createElement;
window.document.createElement = (...arg) => {
    let menent = window.document.createElement_copy(...arg);
    if (arg[0] === 'script') {
        menent.onload = (ev) => {
            // window.zhsngq_data.push(ev.path[0].src);
            console.log(ev.path[0].src);
            let z_ajax = new XMLHttpRequest();
            z_ajax.open('get', ev.path[0].src);
            z_ajax.send();
        }
    }
    return menent;
};
XMLHttpRequest.prototype.newOpen = XMLHttpRequest.prototype.open;
XMLHttpRequest.prototype.open = function() {
    console.log(this.onload);
    this.onreadystatechange = function() {
        if (this.readyState == 4 && this.status == 200) {
            if (this.responseType == 'blob') {
                var re = new FileReader();
                re.readAsText(this.response)
                re.onload = function() {
                    var result = '';
                    try {
                        result = JSON.parse(re.result)
                    } catch (e) {
                        result = false;
                    }
                    if (result) window.zhsngq_data.push(result);
                }
            } else {
                if (this.response != '') window.zhsngq_data.push(this.response);
            }
        } else if (this.readyState == 4 && this.status == 0) {
            console.log('网络异常!');
        }
    };
    this.onload = function() {
        console.log(this);
        if (this.status >= 200 && this.status < 300 || 304 == this.status) {
            if (this.responseType != 'json') {
                window.zhsngq_data.push(JSON.parse(this.response));
            } else {
                window.zhsngq_data.push(this.response);
            }
        }
    }
    this.newOpen.apply(this, arguments);
}
Response.prototype.newJson = Response.prototype.json;
Response.prototype.json = function() {
    window.zhsngq_data.push(this);
    return this.newJson.apply(this, arguments);
}